package com.ruoyi.pay.utils;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.UUID;

import java.util.Random;

public class OrderNoUtils {


    private static String getNo(){
        // YYYYMMDDHHMMSS
        String nowTime = DateUtils.dateTimeNow();

        // 生成一个6位的随机整数（0-999999之间的整数）
        Random random = new Random();
        int sixDigitNumber = random.nextInt((999999 - 100000) + 1) + 100000;

        String No = nowTime + sixDigitNumber;

        return No;
    }

    public static String getOrderNo(){
        String orderNo = "ORDER_" + getNo();
        System.err.println(orderNo);
        return orderNo;
    }

    public static String getRefundNo(){
        String refundNo = "REFUND_" + getNo();
        System.err.println(refundNo);
        return refundNo;
    }
}
